﻿///***************************************************************
/// 시  스  템 : Updms.Prj.Dac
/// 단위시스템 : PRJ
/// 계      층 : Data Access Layer
/// 프로그램명 : Prj_Dac_UPDMS_PRJ_SUMMARY
/// 파  일  명 : Prj_Dac_UPDMS_PRJ_SUMMARY.cs
/// 설      명 : 프로젝트 요약
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2008-07-15 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;


namespace Updms.Prj.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Prj_Dac_UPDMS_PRJ_SUMMARY : Base.AppFramework.DacBase
	{
		public Prj_Dac_UPDMS_PRJ_SUMMARY()
		{
		}

		#region NT [GetSearchCount]
		
		[AutoComplete]
		public int GetSearchCount(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_PRJ_SUMMARY_Get_Search_Count";
			
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			
			return (int)_agent.ExecuteScalar(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [SelectProcess]
		
		[AutoComplete]
		public DataSet SelectProcess(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_PRJ_SUMMARY_Select_Paging";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_PRJ_SUMMARY", ds, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [GetNewPrjId]
		/// <summary>
		/// 신규프로젝트아이디
		/// </summary>
		/// <returns></returns>
		[AutoComplete]
		public string GetNewPrjId()
		{
			string ls_sql = "usp_UPDMS_PRJ_SUMMARY_Get_New_Prj_Id";

			return (string)_agent.ExecuteScalar(ls_sql, null, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [GetProjectInfo]
		/// <summary>
		/// 프로젝트 리스트
		/// </summary>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetProjectInfo()
		{
			string strSql = "usp_UPDMS_PRJ_SUMMARY_Get_Project_Info";

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_PRJ_SUMMARY", ds, null, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [GetProjectInfoReportY]
		/// <summary>
		/// 프로젝트 리스트 - 보고서사용여부가 Y인것만 조회
		/// </summary>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetProjectInfoReportY()
		{
			string strSql = "usp_UPDMS_PRJ_SUMMARY_Get_Project_Info_Report_Y";

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_PRJ_SUMMARY", ds, null, CommandType.StoredProcedure);
		}

		#endregion



		#region RT [Insert]
		
		[AutoComplete]
		public int Insert(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_PRJ_SUMMARY_Insert";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Update]
		
		[AutoComplete]
		public int Update(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_PRJ_SUMMARY_Update";
			
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Delete]
		
		[AutoComplete]
		public int Delete(string ls_xml)
		{
			string strSql = "usp_UPDMS_PRJ_SUMMARY_Delete";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_xml", ls_xml)
			};
			
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

	}
}
